package com.engine4cloud.tdf.supervision.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.common.data.web.response.Params;
import com.engine4cloud.tdf.supervision.dto.create.RcglVerificationEvidenceCreateDTO;
import com.engine4cloud.tdf.supervision.dto.query.RcglVerificationEvidenceQueryDTO;
import com.engine4cloud.tdf.supervision.dto.result.RcglVerificationEvidenceResultDTO;
import com.engine4cloud.tdf.supervision.dto.update.RcglVerificationEvidenceUpdateDTO;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 日常管理-核实取证
 *
 * @author sh
 * @date 2024-08-02 15:07:07
 */
@FeignClient(contextId = "RemoteRcglVerificationEvidenceService", value = ServiceNameConstants.SUPERVISION_SERVER)
public interface RemoteRcglVerificationEvidenceService {

    /**
     * 分页查询
     *
     * @param page 分页对象
     * @param dto  核实取证
     * @return R<PageInfo < RcglVerificationEvidenceResultDTO>>
     */
    @GetMapping("/inner/verification/evidence/page")
    R<PageInfo<RcglVerificationEvidenceResultDTO>> getPageList(@RequestParam("page") Params page, @Valid @RequestParam("dto") RcglVerificationEvidenceQueryDTO dto,
                                                               @RequestHeader(SecurityConstants.FROM) String from);


    /**
     * 通过id查询核实取证
     *
     * @param id id
     * @return R
     */
    @GetMapping("/inner/verification/evidence/{id}")
    R<RcglVerificationEvidenceResultDTO> getById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 新增核实取证
     *
     * @param dto 核实取证
     * @return R
     */
    @PostMapping("/inner/verification/evidence")
    R<Boolean> create(@Valid @RequestBody RcglVerificationEvidenceCreateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 修改核实取证
     *
     * @param dto 核实取证
     * @return R
     */
    @PutMapping("/inner/verification/evidence")
    R<Boolean> update(@Valid @RequestBody RcglVerificationEvidenceUpdateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过id删除核实取证
     *
     * @param ids id列表
     * @return R
     */
    @DeleteMapping("/inner/verification/evidence")
    R<Boolean> removeById(@RequestBody Long[] ids, @RequestHeader(SecurityConstants.FROM) String from);
}
